import request from '@/utils/request'

// 查询零部件记录列表
export function listComponentRecord(query) {
  return request({
    url: '/mes/component/record/list',
    method: 'get',
    params: query
  })
}

// 查询零部件记录详细
export function getComponentRecord(id) {
  return request({
    url: '/mes/component/record/' + id,
    method: 'get'
  })
}

// 新增零部件记录
export function addComponentRecord(data) {
  return request({
    url: '/mes/component/record',
    method: 'post',
    data: data
  })
}

// 修改零部件记录
export function updateComponentRecord(data) {
  return request({
    url: '/mes/component/record',
    method: 'put',
    data: data
  })
}

// 删除零部件记录
export function delComponentRecord(id) {
  return request({
    url: '/mes/component/record/' + id,
    method: 'delete'
  })
}

// 零部件返工
export function reworkComponentRecord(data) {
  return request({
    url: '/mes/component/record/rework',
    method: 'put',
    data: data
  })
} 